GrailsCompany.data.DH.on('loadAll', function() {
    Ext.getCmp('mainWindow').show();
}, this);

var FH = GrailsCompany.form.FH;

Ext.onReady(function () {
    var mainWindow = new Ext.Window({
        id: 'mainWindow',
        resizable: false,
        closable: false,
        width: 600,
        height: 400,
        title: 'Organization App Sample',
        layout: 'border',
        items: [
            {
                xtype: 'panel',
                layout: 'column',
                height: 580,
                width: 600,
                border: false,
                region: 'center',
                items: [
                    treePanel,
                    {
                        id: 'detailsPanel',
                        region: 'center',
                        xtype: 'tabpanel',
                        columnWidth: .7,
                        height: 400,
                        border: false
                    }
                ]
            },
            {
                id: 'statusBar',
                region: 'south',
                xtype: 'panel',
                height: 20,
                width: 600,
                statusUpdate: true,
                listeners: {
                    statusUpdate: function (status) {
                        this.update(status);
                    }
                }
            }
        ],
        listeners: {
            dataUpdate: function (obj, args) {
                Ext.each(this.find('dataUpdate', true), function (item) {
                    item.fireEvent('dataUpdate');
                });
            },
            statusUpdate: function (status) {
                Ext.each(this.find('statusUpdate', true), function (item) {
                    item.fireEvent('statusUpdate', status);
                });
            }
        }
    })
});